package org.apache.ibatis.demo.handler;

import org.apache.ibatis.demo.bean.User;
import org.apache.ibatis.session.ResultContext;
import org.apache.ibatis.session.ResultHandler;

import java.util.List;

/**
 * demo result handler
 *
 * @author zhaohui
 */
public class DemoUserResultHandler implements ResultHandler<User> {

    private List<User> users;

    @Override
    public void handleResult(ResultContext<? extends User> resultContext) {
        User user = resultContext.getResultObject();
        user.setName("123");
        users.add(user);
    }

}
